home *** CD-ROM | disk | FTP | other *** search
- on cursorOff
- global colorcrsr, YugoCursors, gCursorSwitch
- if objectp(colorcrsr) then
- colorcrsr(mGetSetCursor, getProp(YugoCursors, #noCursor))
- set gCursorSwitch to #off
- else
- cursor(200)
- set gCursorSwitch to #off
- end if
- end
-
- on cursorOn
- global colorcrsr, YugoCursors, thisCursor, gCursorSwitch
- if gCursorSwitch = #off then
- if objectp(colorcrsr) then
- colorcrsr(mGetSetCursor, getProp(YugoCursors, thisCursor))
- else
- castCursor(getProp(YugoCursors, thisCursor))
- end if
- set gCursorSwitch to #on
- end if
- end
-
- on castCursor cursorID
- set myCursorOffset to 1400
- if integerp(cursorID) then
- set whichCursor to cursorID - 6000
- else
- put "castCursor(): wow, a cursor label: "
- put cursorID
- exit
- end if
- set cMask to myCursorOffset + (whichCursor * 2)
- cursor([cMask - 1, cMask])
- end
-
- on killVideo
- global lastScoreSprite
- set vidSprite to 44
- set the movieRate of sprite vidSprite to 0
- set the locV of sprite vidSprite to -500
- updateStage()
- set the castNum of sprite vidSprite to 7
- puppetSprite(vidSprite, 0)
- end
-
- on pushVideo start_time, stop_time
- set vidSprite to 44
- set the movieTime of sprite 44 to 0
- updateStage()
- set the movieRate of sprite 44 to 1
- if the paramCount > 0 then
- set the startTime of sprite 44 to start_time
- set the stopTime of sprite 44 to stop_time
- set the movieTime of sprite 44 to start_time
- end if
- repeat while the movieRate of sprite 44 <> 1
- updateStage()
- end repeat
- end
-
- on setCurrentLocation suggestion
- return "Use the goTo() function instead.."
- end
-
- on goTo destination, transition
- global oPuppeteer, oStoryteller, builderWindow, gPreloading, gScanFinish, colorcrsr, YugoCursors, thisCursor, gCursorSwitch, gPeekAlertEnabled, domainIsReady
- report(">starting 'goTo()' (" & the timer & " ticks after mouseDown)")
- if objectp(colorcrsr) then
- colorcrsr(mGetSetCursor, getProp(YugoCursors, #noCursor))
- else
- cursor(200)
- end if
- set gCursorSwitch to #off
- if (destination = #destination) or (transition = #transition) then
- exit
- end if
- report(">cursorOff done (" & the timer & " ticks)")
- setAt(getProp(the lsStateData of oStoryteller, #previousLocation), 1, getAt(getProp(the lsStateData of oStoryteller, #currentLocation), 1))
- setAt(getProp(the lsStateData of oStoryteller, #currentLocation), 1, destination)
- if the castNum of sprite 44 <> 7 then
- killVideo()
- moveMovies(oPuppeteer)
- end if
- setTransition(oPuppeteer, transition)
- report(">'setTransition()' done (" & the timer & " ticks)")
- moveToLocation(oPuppeteer)
- report(">'moveToLocation()' done (" & the timer & " ticks)")
- if getPos(the windowList, builderWindow) then
- tell builderWindow
- refreshCast()
- refreshHotspots()
- end tell
- end if
- if gPreloading = 1 then
- preloadLocations()
- report(">preLoadLocations done (" & the timer & " ticks)")
- else
- report(">preLoadLocations skipped (" & the timer & " ticks)")
- end if
- report(" Available memory: " & the freeBytes / 1024 & " K (incl. " & the freeBlock / 1024 & " K block)")
- report(" :")
- set lsMoveCounter to getProp(the lsStateData of oStoryteller, #moveCount)
- set oldCount to getAt(lsMoveCounter, 1)
- setAt(lsMoveCounter, 1, oldCount + 1)
- if domainIsReady then
- if the castNum of sprite 44 <> 7 then
- killSongs(#PConly)
- else
- playaSong()
- end if
- end if
- return #OK
- end
-
- on goBack
- global oStoryteller
- goTo(getState(oStoryteller, #previousLocation), #backOff)
- end
-
- on idle
- global lastCursor, thisCursor, cursorOffset, castCursorList, maxCursor, oStoryteller, oPuppeteer, gCurrentHotspot, gItemInUse, domainIsReady, gPreloading, gStopTransitions, g16bit, gTransQuality, gFreezeInventory, gSoundPath, gOriginPoint, gMenuBottomY, gGustReady, gGammaLevel, gDeferredTransit
- if gDeferredTransit = #none then
- if domainIsReady then
- cursorOn()
- set thisCursor to #pointer
- set gCurrentHotspot to #none
- if the mouseV < gMenuBottomY then
- if the number of menus = 0 then
- installMenu(the number of cast "Amber menus")
- if gTransQuality = #none then
- set the checkMark of menuItem 1 of menu 3 to 1
- end if
- if gTransQuality = #Better then
- set the checkMark of menuItem 2 of menu 3 to 1
- end if
- if gTransQuality = #Best then
- set the checkMark of menuItem 3 of menu 3 to 1
- end if
- set the checkMark of menuItem (8 - the soundLevel) of menu 2 to 1
- if gGammaLevel <> "unknown" then
- set the checkMark of menuItem (8 - gGammaLevel) of menu 4 to 1
- end if
- set thisCursor to #pointer
- end if
- else
- installMenu(0)
- end if
- set mouseLoc to point(the mouseH, the mouseV) - gOriginPoint
- repeat with i in the lsLiveHotspots of oPuppeteer
- if inside(mouseLoc, getAt(i, 2)) then
- set myCursor to getAt(i, 1)
- if myCursor = #itemInUse then
- set thisCursor to getState(oStoryteller, #itemInUse)
- else
- set thisCursor to myCursor
- end if
- set gCurrentHotspot to i
- exit repeat
- end if
- end repeat
- prodVLoops()
- if thisCursor <> lastCursor then
- cursorDance(value(lastCursor & "To" & thisCursor))
- set lastCursor to thisCursor
- end if
- end if
- if domainIsReady and gGustReady then
- gust()
- end if
- else
- do(gDeferredTransit)
- if gDeferredTransit contains "waiting" then
- if domainIsReady = 1 then
- if getState(oStoryteller, #currentDomain) = the last word in gDeferredTransit then
- set gDeferredTransit to #none
- end if
- end if
- end if
- end if
- end
-
- on cursorDance cursorList
- global colorcrsr, thisCursor, YugoCursors, gCPU
- if gCPU <> #PC then
- if not objectp(colorcrsr) then
- cursor(-1)
- set colorcrsr to ColorCursor(mnew)
- end if
- end if
- if not listp(cursorList) then
- if objectp(colorcrsr) then
- colorcrsr(mGetSetCursor, getProp(YugoCursors, thisCursor))
- else
- castCursor(getProp(YugoCursors, thisCursor))
- end if
- exit
- end if
- set flipBook to cursorList
- if objectp(colorcrsr) then
- repeat with flipper = 1 to count(flipBook)
- startTimer()
- colorcrsr(mGetSetCursor, getAt(flipBook, flipper))
- repeat while 2 > the timer
- nothing()
- end repeat
- end repeat
- else
- repeat with flipper = 1 to count(flipBook)
- startTimer()
- castCursor(getAt(flipBook, flipper))
- repeat while 2 > the timer
- nothing()
- end repeat
- end repeat
- end if
- end
-
- on inState stateVar, whichItem
- global oStoryteller
- set statelist to getProp(the lsStateData of oStoryteller, stateVar)
- return getPos(statelist, whichItem)
- end
-
- on trimState stateVar, whichItem
- global oStoryteller
- set statelist to getProp(the lsStateData of oStoryteller, stateVar)
- set myPos to getPos(statelist, whichItem)
- if myPos then
- deleteAt(statelist, myPos)
- end if
- end
-
- on addState stateVar, whichItem
- global oStoryteller
- set statelist to getProp(the lsStateData of oStoryteller, stateVar)
- set myPos to getPos(statelist, whichItem)
- if not myPos then
- append(statelist, whichItem)
- end if
- end
-
- on patchPalette
- global oFixPal
- oFixPal(mPatchIt)
- end
-
- on forcePalette palName
- global oPuppeteer, gCurrentPalette
- puppetPalette(palName, 60)
- set gCurrentPalette to #changeMe
- patchPalette()
- end
-
- on loadMultiFrames whichOnes
- global oPuppeteer
- set theFrames to getaProp(the lsMultiFrames of oPuppeteer, whichOnes)
- if listp(theFrames) then
- repeat with i in theFrames
- preLoadCast(i)
- end repeat
- else
- alert("Hey! There's no such list in lsMultiframes!")
- end if
- end
-
- on purgeMultiframes whichOnes
- global oPuppeteer
- set theFrames to getaProp(the lsMultiFrames of oPuppeteer, whichOnes)
- if listp(theFrames) then
- repeat with i in theFrames
- unLoadCast(i)
- end repeat
- else
- alert("Hey! There's no such list in lsMultiframes!")
- end if
- end
-
- on disablePeekAlert
- nothing()
- end
-
- on enablePeekAlert
- nothing()
- end
-
- on gammaFade upOrDown, howFast
- global gCPU
- if gCPU = #PC then
- exit
- end if
- set speedCodes to [#glacial: "4", #slow: "18", #fast: "36", #instant: "100"]
- set mySpeed to getaProp(speedCodes, howFast)
- if voidp(mySpeed) then
- set mySpeed to getProp(speedCodes, #fast)
- end if
- if upOrDown = #down then
- MonitorFade("down", mySpeed)
- else
- updateStage()
- MonitorFade("up", mySpeed)
- end if
- end
-
- on setColor howManybits
- set the colorDepth to howManybits
- if the colorDepth <> howManybits then
- if howManybits = 16 then
- set the colorDepth to 32
- else
- put "Sorry, Director sez the colorDepth is " & the colorDepth & " bits.."
- end if
- else
- end if
- end
-
- on fadeToMontage whichNumber
- global oStoryteller, oPuppeteer
- setState(oStoryteller, #showMontage, whichNumber)
- setTransition(oPuppeteer, #fadeIn)
- updateDisplay(oPuppeteer)
- end
-
- on fadeOutTransit
- repeat with fadeFactor = 30.0 down to 0.0
- repeat with i = 1 to 4
- set the volume of sound i to float(the volume of sound i) * (fadeFactor / 30.0)
- end repeat
- wait(8)
- updateStage()
- end repeat
- end
-
- on playaSong
- global oStoryteller, gSoundsSuspended, gLastCarolStart
- if gSoundsSuspended then
- exit
- end if
- if getState(oStoryteller, #carolsEnabled) = 0 then
- exit
- end if
- if voidp(gLastCarolStart) then
- set gLastCarolStart to 0
- end if
- if (the ticks - 12600) < gLastCarolStart then
- exit
- end if
- set lsCarols to getProp(the lsStateData of oStoryteller, #windSongs)
- set soundChannels to getProp(the lsStateData of oStoryteller, #soundChannels)
- repeat with whichSound in lsCarols
- repeat with i = 1 to count(soundChannels)
- set theChannel to getAt(soundChannels, i)
- if getProp(theChannel, #sndName) = whichSound then
- if soundBusy(i) then
- exit
- end if
- end if
- end repeat
- end repeat
- set newSong to getAt(lsCarols, 1)
- startSound(newSong)
- set nextSong to getLast(lsCarols)
- setState(oStoryteller, #windSongs, nextSong)
- set gLastCarolStart to the ticks
- end
-
- on killSongs optionSwitch
- global oStoryteller, gSoundsSuspended, gCPU
- if gSoundsSuspended then
- exit
- end if
- if (optionSwitch = #PConly) and (gCPU <> #PC) then
- exit
- end if
- set lsCarols to getProp(the lsStateData of oStoryteller, #windSongs)
- set soundChannels to getProp(the lsStateData of oStoryteller, #soundChannels)
- repeat with whichSound in lsCarols
- repeat with i = 1 to count(soundChannels)
- set theChannel to getAt(soundChannels, i)
- if getProp(theChannel, #sndName) = whichSound then
- if soundBusy(i) then
- repeat with fadeFactor = 30.0 down to 10.0
- set the volume of sound i to float(the volume of sound i) * (fadeFactor / 30.0)
- wait(4)
- updateStage()
- end repeat
- set the volume of sound i to 0
- puppetSound(i, 0)
- sound stop i
- exit repeat
- end if
- end if
- end repeat
- end repeat
- end
-
- on killSound whichSound
- global oStoryteller
- set soundChannels to getProp(the lsStateData of oStoryteller, #soundChannels)
- repeat with i = 1 to count(soundChannels)
- set theChannel to getAt(soundChannels, i)
- if getProp(theChannel, #sndName) = whichSound then
- if soundBusy(i) then
- repeat with fadeFactor = 30.0 down to 10.0
- set the volume of sound i to float(the volume of sound i) * (fadeFactor / 30.0)
- wait(4)
- updateStage()
- end repeat
- set the volume of sound i to 0
- puppetSound(i, 0)
- sound stop i
- exit repeat
- end if
- end if
- end repeat
- end
-
- on pushQT startTime, stopTime, ticksPerFrame
- set QTsprite to 44
- set totalTime to stopTime - startTime
- set the movieTime of sprite 44 to startTime
- startTimer()
- repeat while the timer <= totalTime
- set the movieTime of sprite 44 to startTime + the timer
- updateStage()
- end repeat
- set the movieTime of sprite 44 to stopTime
- updateStage()
- end
-
- on prerollQT startTime, stopTime, ticksPerFrame
- set QTsprite to 44
- set OnStage to the loc of sprite QTsprite
- set the loc of sprite QTsprite to point(-10, -10)
- set mTime to startTime
- set the movieTime of sprite QTsprite to mTime
- repeat while mTime < stopTime
- set mTime to mTime + ticksPerFrame
- set the movieTime of sprite QTsprite to mTime
- end repeat
- set the loc of sprite QTsprite to OnStage
- set the visible of sprite QTsprite to 1
- end
-
- on enableSongs
- global oStoryteller
- setState(oStoryteller, #carolsEnabled, 1)
- end
-
- on disableSongs
- global oStoryteller
- setState(oStoryteller, #carolsEnabled, 0)
- killSongs()
- end
-